package com.dlb.andorid.activity;

import android.view.View;
import android.widget.TextView;

import com.dlb.andorid.App;
import com.dlb.andorid.R;
import com.kwan.xframe.mvp.presenter.BasePresenter;
import com.kwan.xframe.mvp.view.activity.BaseCommonActivity;

public class MyPropertyActivity extends BaseCommonActivity {


	@Override
	protected BasePresenter getBasePresenter() {
		return null;
	}

	@Override
	protected void initData() {

	}

	View  ll_yhq, ll_zxcz, ll_tx, ll_jf, ll_mx;

	private TextView tv_title_coin,tv_title_point,tv_title_coupon,tv_coin,tv_point,tv_money;

	@Override
	protected void initViews() {
		super.initViews();
		if (layoutTitle != null) {
			layoutTitle.setBackgroundColor(getResources().getColor(com.kwan.xframe.R.color.color_red));
		}
		tv_money= findViewById(R.id.tv_money);
		tv_title_coin= findViewById(R.id.tv_title_coin);
		tv_title_point= findViewById(R.id.tv_title_point);
		tv_title_coupon= findViewById(R.id.tv_title_coupon);

		tv_coin= findViewById(R.id.tv_coin);
		tv_point= findViewById(R.id.tv_point);

		tv_money.setText(App.mUserInfo.getBalance_num()+"");

		tv_title_coin.setText("金币\n\n"+App.mUserInfo.getGold_coin());
		tv_title_point.setText("积分\n\n"+App.mUserInfo.getIntegral_num());
		tv_title_coupon.setText("优惠券\n\n"+App.mUserInfo.getCoupon_num());

		tv_coin.setText("金币："+App.mUserInfo.getGold_coin());
		tv_point.setText("积分："+App.mUserInfo.getIntegral_num());

		ll_yhq = findViewById(R.id.ll_yhq);
		ll_zxcz = findViewById(R.id.ll_zxcz);
		ll_tx = findViewById(R.id.ll_tx);
		ll_jf = findViewById(R.id.ll_jf);
		ll_mx = findViewById(R.id.ll_mx);

		ll_yhq.setOnClickListener(this);
		ll_tx.setOnClickListener(this);
		ll_zxcz.setOnClickListener(this);
		ll_jf.setOnClickListener(this);
		ll_mx.setOnClickListener(this);

	}

	@Override
	public void onClick(View v) {
		super.onClick(v);

		if (v == ll_yhq) {
			go2Activity(CouponListActivity.class, null, false);
		} else if (v == ll_tx) {
			go2Activity(TxActivity.class, null, false);
		} else if (v == ll_zxcz) {
			go2Activity(RechargeActivity.class, null, false);
		} else if (v == ll_jf) {
			go2Activity(PointActivity.class, null, false);
		} else if (v == ll_mx) {
			go2Activity(MxActivity.class, null, false);
		}
	}

	@Override
	protected int getTopViewId() {
		return 0;
	}

	@Override
	protected int getMainViewId() {
		return R.layout.activity_my_property;
	}

	@Override
	protected int getBottomViewId() {
		return 0;
	}

	@Override
	protected String getTitleTxt() {
		return "我的资产";
	}

	@Override
	public String getPageName() {
		return null;
	}
}
